package com.ishopping.service.manage.mapper;

import java.util.List;

import com.github.abel533.mapper.Mapper;
import com.ishopping.api.manage.entity.RolePermission;
import org.apache.ibatis.annotations.Param;

public interface RolePermissionMapper extends Mapper<RolePermission> {
    /**
     * 通过roleId获取用户权限
     * @param roleId
     * @return List<Long>
     */
    List<RolePermission> queryRolePermissionsByRoleId(Long roleId);

    /**
     * 通过roleId删除其关联的权限
     * @param roleId
     * @return int
     */
    int deleteByRoleId(Long roleId);

    /**
     * 批量插入用户关联的权限
     * @param list
     * @param roleId
     * @return int
     */
    int batchInsert(@Param("roleId") Long roleId, @Param("permIdList") List<Long> list);
}